package com.flycat.common.util;


import java.util.*;

/**
 * @Author yalei.chen
 * @Date 2017/10/17
 * @Since JDK 1.8
 */
public class CouponUtils {

    private static final int DEFAULT_LENGTH = 7;

    public static String getCouponCode() {

        Random random = new Random();
        int bound = random.nextInt(9999999);
        String code =RC4.encry_RC4_string(String.format("%0"+DEFAULT_LENGTH+"d",bound), UUID.randomUUID().toString().toUpperCase());
        return code;
    }

}
